home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_lag_waterlightrand.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  74 lines

  1. # Jones 3D Cog Script
  2. #
  3. # lag_WaterLightRand.cog
  4. #
  5. #  [RT]
  6. #  Modified & localized settings for Lag underwater ship interior from gen_LightAnimRand.cog [DS]
  7. #
  8. #    This cog randomly animates up to 8 dynamic light sources, allowing the designer to
  9. #  specify minimum and maximum completion times, pause times and RGB values.
  10. #
  11. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  12. # ========================================================================================
  13.  
  14. symbols
  15.  
  16.     message    startup
  17.     message    timer
  18.  
  19.     thing        light0
  20.     thing        light1
  21.     thing        light2
  22.     thing        light3
  23.     thing        light4
  24.     thing        light5
  25.     thing        light6
  26.     thing        light7
  27.     
  28.     flex        minR=0.0        local        // Minimum RGB values
  29.     flex        minG=0.0        local        
  30.     flex        minB=0.0        local                  
  31.     flex        minTime=0.1        local        // Minimum time to complete lighting change
  32.     flex        minPause=0.1    local        // Minimun time to pause between cycles
  33.  
  34.     flex        rangeR=0.1        local        // How far above minimum values do we go? Min + Range = Max
  35.     flex         rangeG=0.8        local
  36.     flex        rangeB=1.0        local
  37.     flex        rangeTime=2.0    local
  38.     flex        rangePause=0.25    local
  39.  
  40.     int        i            local
  41.     int        numLights=0        local
  42.     float        changeTime        local
  43.     
  44.     vector    vecLight        local
  45.  
  46. end
  47.  
  48. # ========================================================================================
  49.  
  50. code
  51.  
  52. startup:
  53.  
  54.     for (i = 0; i < 8; i = i + 1)
  55.         if (light0[i] >= 0)
  56.             numLights = numLights + 1;
  57.    
  58.     SetTimer(0.1);
  59.    return;
  60.  
  61. timer:
  62.  
  63.     vecLight = VectorSet(minR + (rand() * rangeR), minG + (rand() * rangeG), minB + (rand() * rangeB));
  64.     changeTime = minTime + (rand() * rangeTime);
  65.    
  66.     for (i = 0; i < numLights; i = i + 1)
  67.       SetThingLight(light0[i], vecLight, 0.5, changeTime);
  68.  
  69.    Sleep(changeTime);
  70.    SetTimer(.01 + minPause + (rand() * rangePause));
  71.     return;
  72.  
  73. end
  74.